This invention relates in general to authoring hints for a font, and in particular to authoring hints for a font using a graphical user interface.
A font is a particular style of typeface such as Arial, Times New Roman or Courier. Fonts which conform to the TrueType Open font standard promulgated by Microsoft Corporation, assignee of the present invention, are commonly referred to as TrueType fonts. TrueType fonts contain font tables that include data, such as glyph outlines, metrics, bitmaps, and mapping information. A glyph outline is a set of mathematical data that describes the shape of the glyph. A glyph is a representation of one or more characters. A single glyph may represent a single character such as the lowercase letter xe2x80x9cfxe2x80x9d or a single glyph may represent a string of characters such as the ligature xe2x80x9cfixe2x80x9d.
To display or print a glyph, the glyph outline is first scaled to the selected font size and the resolution of the output device. The scaled glyph outline is then digitized or scan-converted to create a bitmap. Finally, the bitmap is rendered on an output device, such as a monitor or a printer, using a regularly spaced grid of picture elements (xe2x80x9cpixelsxe2x80x9d). Scaling the glyph outline may not produce satisfactory results at all point sizes. At small point sizes, a low-resolution device may not have enough pixels to fill in the outline accurately. To compensate for the lack of pixels, hints or font instructions are added to the font to improve the appearance of the glyph. Hints typically control distances, proportions and pixel patterns.
For a TrueType font, a typographer may specify hints for the entire font or for individual glyphs using an assembly-type language. The typographer may use the low-level TrueType Instruction Set, or a high-level abstraction of the TrueType Instruction Set, such as Type Man Talk. Creating hints using one of the TrueType languages is often a tedious process. To begin creating hints for a glyph, the typographer typically prints a glyph outline for the glyph. The glyph outline includes control points which define the shape of the glyph. The typographer uses the glyph outline to visualize critical relationships between the control points, such as the distance in the x-direction between two control points or the distance in the y-direction between two control points. The typographer then draws these relationships on the glyph outline using colored pencils.
Once the typographer draws the relationships on the glyph outline, the typographer translates the colored pencil markings into font instructions. The translation requires that the typographer not only convert the relationships into the proper TrueType commands, but also requires that the typographer order the commands according to the command sequence requirements of the TrueType Instruction Set.
Once the typographer translates the relationships into font instructions, the font instructions are compiled and the compiled font instructions are used to display a bitmap for the glyph. The typographer reviews the bitmap to determine whether the appearance of the hinted glyph is satisfactory. If the appearance of the hinted glyph is not satisfactory, then the typographer must modify the font instructions or add additional font instructions. The typographer must repeat these steps until the appearance of the hinted glyph is satisfactory. If the typographer adds an additional font instruction, then the typographer must determine where to insert the font instruction. Because the TrueType Instruction Set requires certain command sequences, determining where to insert the additional font instruction is not usually obvious. If the additional font instruction is not inserted in the correct sequence, then the font instructions will not be correctly applied.
For the majority of typographers, it would be easier to hint a glyph if the relationships drawn on the glyph outline could be translated into font instructions without the typographer""s intervention. In addition, it is easier to prevent or debug hinting errors, if the font instructions are shown on the glyph outline. For example, it is easier for the typographer to recognize a circular relationship if the circular relationship is shown graphically on the glyph outline, than if the circular relationship is only apparent from the font instructions.
One proposed solution to the hinting problem is provided by the Fontographer program marketed by Macromedia of San Francisco, Calif. The Fontographer program assists a typographer in designing a font by providing tools to support glyph outline design. The Fontographer program also provides some rudimentary hinting tools. The Fontographer program allows a typographer to specify horizontal and vertical serif hints, horizontal and vertical stem hints, and diagonal hints. For example, to specify a vertical stem hint, the typographer selects two points which define the vertical stem and then selects the xe2x80x9cmake vertical stemxe2x80x9d command from the hints menu. The typographer may control the width of the vertical stem by specifying the x-coordinates of the stem. Typically, the x-coordinates of the stem are specified by editing the stem start and stem stop fields of a menu.
One drawback of the Fontographer program is that the hinting tools are limited. The TrueType instruction set includes many hinting instructions which are not supported by the Fontographer program. For example, the Fontographer program does not support interpolations or alignments.
Another drawback of the hinting tools provided by the Fontographer program is that hints must be specified in coordinates. For a TrueType font, it is more efficient to specify a hint using a control value. A control value is a value for a dominant width, length, or angle of a group of features, such as the stem width or serif length. Control values are stored in a font table commonly referred to as a control value table (xe2x80x9ccvtxe2x80x9d). Some control values are specific to certain glyphs, while other control values apply to the entire font. Requiring hints to refer to control values makes it easier to preserve regularity between the glyphs of the font.
Yet another drawback of the Fontographer program is that it displays hints outside the glyph outline. Displaying hints outside the glyph outline makes it difficult to identify the control points associated with a hint. Furthermore, Fontographer does not have a built-in rasterizer so a typographer cannot immediately see how a hint affects the appearance of a rendered glyph. The lack of a built-in rasterizer makes it difficult to fine-tune pixel patterns and stroke weights.
Accordingly, there is a need in the art for a method for authoring hints for a glyph using a graphical user interface. There is also a need in the art for a graphical method for authoring hints using control point values.
The present invention meets the needs described above by permitting a typographer to drag and drop graphical hints on a displayed glyph using a graphical user interface. The graphical user interface provides the typographer with a number of hinting tools which correspond to hinting functions. The typographer specifies a graphical hint by selecting a hinting tool and selecting one or more points that define the glyph outline, such as a control point. The graphical hints are represented by graphical elements displayed on the glyph. The shape and color of the graphical elements indicate the type of hinting function. Options for the graphical hints are represented by graphical components.
The graphical hints are compiled and placed in the font tables without requiring that the typographer manually code the hints. Once the graphical hints for a glyph are compiled, the hinted glyph is displayed. If the appearance of the hinted glyph is not satisfactory, then the typographer can modify the existing graphical hints or add additional graphical hints until the appearance of the hinted glyph is satisfactory. The typographer can modify an existing graphical hint by selecting a portion of the graphical element and modifying the aspect of the hint that corresponds to that portion of the graphical element. For example, the typographer can modify the parent control point of a link by selecting the tail of an arrow representing the link and dragging the tail to a new parent control point.
A number of tools are provided by the graphical user interface, including viewing tools, control point tools, hinting tools and display tools. The display tools include snap shot, jump back and size run tools. The viewing tools include tools for panning, measuring, and zooming. The control point tools include tools for moving, swapping, deleting or adding a control point. The hinting tools include tools for linking, shifting, interpolating, aligning and moving, as well as tools for specifying an angle and a stroke.
The hinting tools allow the typographer to specify a hinting function. Typically, the typographer selects a hinting tool and then drags the selected tool between control points. Once the hinting tool and the control points are selected, the graphical hint is represented by a graphical element, such as an arrow, displayed on the glyph.
To hint a font using a graphical user interface, the typographer loads a font. Loading the font typically includes loading the necessary font data and stripping any hints previously created. Once the font is loaded, the typographer completes the control value table or cvt. The cvt is a font table defining the dominant width, length, or angle of a group of features, such as the stem width or the serif length. Completing the cvt typically includes measuring a number of representative glyphs using the measuring tool and using the most common values to complete the cvt. The typographer can specify cvt values when hinting a glyph. The ability to specify cvt values helps the typographer achieve consistency across the glyphs of the font.
Once the cvt is completed, the typographer selects a glyph to hint. The typographer hints the selected glyph by dragging and dropping graphical hints on the selected glyph. For example, to specify a link, the typographer selects the link tool. The typographer then drags the link tool between a first control point and a second control point. A graphical element, such as an arrow, appears between the two control points. The tail of the arrow is connected to the parent control point and the arrowhead is connected to the child control point. The typographer can specify options for the link, such as a stroke category option, a minimum distance option, or a cvt value by selecting the desired options from a menu. The selected stroke category option is represented by the shape of the arrowhead of the graphical element representing the link. The selected minimum distance option and the selected cvt value are represented by graphical components displayed with the graphical element.
The graphical user interface can be used to specify other types of hints, including an interpolation. To specify an interpolation, the typographer selects the interpolate tool. The typographer then drags the interpolate tool between a first control point and a second control point. A graphical element, such as a band, appears between the two control points. The band indicates that the two control points are the parent control points for the interpolation. The typographer selects the band and drags the band to a third control point. The graphical element changes from a band to a pair of arrows. The tail of one of the arrows is connected to the first control point and the arrowhead is connected to the third control point. The tail of the other arrow is connected to the second control point and the arrowhead is connected to the third control point. The pair of arrows is a graphical representation of the interpolation of the third control point between the first control point and the second control point.
The graphical element and the graphical components can be used to modify the graphical hints. By selecting different portions of the graphical element, different aspects of the hint are modified. For example, selecting the tail of the arrow representing a link or an interpolation allows the typographer to select a new parent control point. Selecting a graphical component representing the minimum distance option, allows the typographer to select a new minimum distance option.
If the automatic compile option is enabled, then the hints are automatically compiled as the glyph is hinted. The automatic compile option allows the typographer to immediately see the effect of a hint on the glyph. If the automatic compile option is not enabled, then a hint is not compiled until the typographer compiles the hint, typically by selecting a compile option from a menu.
Once the hints are compiled, the selected glyph is redisplayed. Typically, the selected glyph is displayed using the bitmap display option. If the appearance of the hinted glyph is not acceptable, then the typographer modifies or deletes the existing hints or adds additional hints until the appearance of the hinted glyph is acceptable. Once the appearance of the hinted glyph is acceptable, the typographer can hint another glyph. Additional glyphs are selected until all the glyphs of the font are hinted.
These and other aspects, features and advantages of the present invention may be more clearly understood and appreciated from a review of the following detailed description of the disclosed embodiments and by reference to the appended drawings and claims.